package cn.yq.share.controller;

import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.HashMap;
import java.util.Map;

/**
 * @author 007
 * @version V1.0
 * @Description:
 * @date 2018/11/21 10:11
 */
@Controller
public class test2Controller {

    @RequestMapping("/test1")
    @ResponseBody
    public String test1(){
        Map map = new HashMap();
        map.put("crp","tianzhi");
        map.put("date","20181121");
        JSONObject jsonObject = JSONObject.parseObject(JSON.toJSONString(map));
        return jsonObject.toString();
    }
}
